package com.hpeng.sys.dao.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.hpeng.sys.dao.DepartmentsDao;
import com.hpeng.sys.model.Department;
import com.hpeng.util.GenericDaoImpl;

@Component("departmentsDao")
public class DepartmentsDaoImpl extends GenericDaoImpl<Department, String> implements DepartmentsDao {
	public List<Department> getDepartments(){
		return getAll();
	}
	public List<Department> getDepartmentsByName(String departmentName){
		List<Department> departments = null;
		departments = getByHql("from Department department where department.depname like '%"+departmentName+"%'");
		return departments;
	}
	public Department getById(String id){
		System.out.println(id+"asdasd");
		return get(id);
	}
}
